package com.tang.model.state.v1;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2021/9/4 22:25
 * @Desc
 * @Remarks
 */
public class UnLoginState extends AbstractState {



    @Override
    public void favorite() {
        login();
        this.userContext.favorite();
    }

    private void login() {
        System.out.println("跳转到登录页面进行登录");
        this.userContext.switchState(UserContext.LOGIN_STATE);
    }

    @Override
    public void comment(String comment) {
        login();
        this.userContext.comment(comment);
    }

}
